﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GamePlusClassLibrary;

namespace GamePlus
{
    public partial class MeusAmigos : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Master.UsuarioLogado())
                Response.Redirect("Default.aspx");
        }

        private void CarregarAmigos()
        {
            string sLi = string.Empty;

            List<Usuario> ls = UsuarioAmigo.ListarAmigos(1);
            ls.ForEach(delegate(Usuario objUsuario) {
                sLi += "<li><div href=\"/Perfil.aspx?c="+ objUsuario.Idf_Usuario.Value.ToString() +"\" class=\"bdc5 blink item\">";
                sLi += "<a href=\"#\"><img class=\"img bdc2\" src=\"/images/avatar/"+ objUsuario.Idf_Usuario.Value.ToString() +".jpg\"  alt=\"\">";
                sLi += "<strong class=\"clr5\">"+ objUsuario.Nme_Usuario +"</strong></a>";
                sLi += "<a href=\"#\" class=\"overact bgc5\"><span class=\"over\">Remover amigo </span>-</a></div></li>";
            });

            ulamigos.InnerHtml = string.Empty;
            ulamigos.InnerHtml = sLi;
        }
    }
}